package com.month.ai.vo;
import org.springframework.ai.chat.messages.AbstractMessage;
import org.springframework.ai.chat.messages.AssistantMessage;
import org.springframework.ai.chat.messages.MessageType;
import org.springframework.ai.chat.messages.UserMessage;

import java.util.HashMap;


public class SimpleMessage extends AbstractMessage{


    private   SimpleMessage(String messageType, String textContent) {
        super(MessageType.fromValue(messageType.toLowerCase()), textContent, new HashMap<>());
    }


    public static AbstractMessage createMessage(String messageType, String textContent) {
        if ("ASSISTANT".equalsIgnoreCase(messageType)) {
            return new AssistantMessage(textContent);
        } else {
            return new SimpleMessage(messageType, textContent);
        }
    }
}
